package com.retail.order.mapper;

import com.retail.core.common.CommonMapper;
import com.retail.order.entity.vo.NameValueVo;
import com.retail.order.entity.vo.RetailOrderDailyStasticsVo;
import com.retail.order.entity.vo.RetailSettleOrderVo;
import com.retail.order.entity.request.RetailSettleOrderRequest;
import com.retail.order.entity.vo.StatisticsOrderDetailVo;
import com.retail.system.entity.vo.AdminStatisticsShopVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* 订单信息 Mapper
* @author Administrator
*/
@Mapper
public interface RetailSettleOrderMapper extends CommonMapper<RetailSettleOrderRequest, RetailSettleOrderVo> {
    RetailSettleOrderVo getModelByOrderIdAndSource(@Param("orderId") String orderId, @Param("orderSource") Integer orderSource);

    /**
     * 查询用户订单信息
     * @param adminId
     * @return
     */
    List<RetailSettleOrderVo> findOwnerOrderByAdminId(@Param("adminId") String adminId);

    List<RetailSettleOrderVo> myOrderList(@Param("adminId")String adminId);

    List<RetailSettleOrderVo> myShopOrderList(@Param("adminId")String adminId);

    List<RetailSettleOrderVo> getOrdersByShop(@Param("poiId") String poiId);

    RetailSettleOrderVo getModelByOrderIdLimit1(@Param("orderId") String orderId);

    List<RetailSettleOrderVo> findOwnerOrderByAdminIdNotInVerifDetail(@Param("adminId") Long adminId);

    AdminStatisticsShopVo statisticsOrder(@Param("adminId") Long adminId);

    List<RetailSettleOrderVo> findSuccessOwnerOrderByAdminId(@Param("adminId") String adminId);
    List<RetailSettleOrderVo> findSuccessOwnerOrderByAdminIdAndId(@Param("adminId") String adminId);

    List<RetailSettleOrderVo> findtoBeanVerifyOrderByAdminId(@Param("adminId")Long adminId, @Param("verifyMonth") String verifyMonth);
    List<RetailSettleOrderVo> findtoBeanVerifyOrderByYwyAdminId(@Param("adminId")Long adminId, @Param("verifyMonth") String verifyMonth);

    Map<String, Object> getOrderMonthStastics(@Param("adminId") Long adminId, @Param("adminType") Integer adminType, @Param("startTimestamp") Long startTimestamp, @Param("endTimestamp") Long endTimestamp);

    List<RetailOrderDailyStasticsVo> getDailyOrderMonthStastics(@Param("adminId") Long adminId, @Param("adminType") Integer adminType, @Param("startTimestamp") Long startTimestamp, @Param("endTimestamp") Long endTimestamp);

    List<RetailSettleOrderVo> findtoBeanVerifyOrderByAdminIdDay(@Param("adminId")Long adminId, @Param("verifyMonth") String verifyMonth);

    List<RetailSettleOrderVo> findtoBeanVerifyOrderByYwyAdminIdDay(@Param("adminId")Long adminId, @Param("verifyMonth") String verifyMonth);

    Integer allOrders();


    @MapKey("adminId")
    Map<String, Object> orderFullStatisticsByAdminId(@Param("adminId") Long adminId);

    @MapKey("adminId")
    Map<String, Object> orderFullStatisticsByTuanduizId(@Param("adminId")Long adminId);

    List<StatisticsOrderDetailVo> orderFullStatistics(@Param("adminId") Long adminId, @Param("userType") Integer userType, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("dateType") String dateType);

    List<NameValueVo> orderShopStatistics(@Param("adminId")Long adminId, @Param("userType")Integer userType, @Param("startTime") String startTime, @Param("endTime")String endTime, @Param("dateType") String dateType);

    List<StatisticsOrderDetailVo> ordershopListFullStatistics(@Param("adminId") Long adminId, @Param("userType") Integer userType, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("dateType") String dateType);


//    RetailSettleOrderVo getModelByOrderId(String orderId);

}
